/*
 * Copyright 2008, 2009 Kobi Krasnoff
 * 
 * This file is part of "Catch Falling Coins".
 *
 * "Catch Falling Coins" is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * "Catch Falling Coins" is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with "Catch Falling Coins".  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import java.io.IOException;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;

/**
 * This is the basic falling object from the sky.<br>
 * All the falling objects derives from this object. 
 * @author kobi
 *
 */
public abstract class BasicObjectSprite extends Sprite {
	public int screenHeight = 0;
	private Image mainImage;
		
	public BasicObjectSprite(Image img)
	{
		super(img);
	}
	
	public void setScreenHeight(int screenHeight)
	{
		this.screenHeight = screenHeight;
	}
	
	public abstract void fall();
	public abstract void endFall();
	public abstract int returnBasicObjectSpriteType();
	
	
	protected void setImage(String imgString, int width, int height)
	{
		try
		{
			mainImage = Image.createImage(imgString);
		}
		catch (IOException ioe) {}
		this.setImage(mainImage, width, height);
	}
}
